package com.tarena.lbs.basic.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.basic.pojo.po.TagLibraryPO;
import com.tarena.lbs.basic.pojo.po.TagLibraryPO1;
import com.tarena.lbs.basic.pojo.query.TagQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TagMapper extends BaseMapper<TagLibraryPO> {
    @Select("select * from lbs_tag_library where tag_name=#{tagName}")
    TagLibraryPO getTagInfoByName(String tagName);

//    @Select("<script>" +
//            "SELECT  * FROM lbs_tag_library tl LEFT JOIN lbs_tag_type ty ON tl.tag_parent_id = ty.id    " +
//            "<where>" + " <if test='tagName != null  '>" +
//            "         tag_name=#{tagName}" +
//            "   </if>  \" <if test='status != null  '>\" +" +
//            "tl.status=#{status}" +
//            "</if></where>" +
//            " order by tl.id desc"
//            +"</script>")
    List<TagLibraryPO1> selectList1(TagQuery query);

    List<TagLibraryPO>selectListLibraryTag(String tagName);
}
